<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<h2>
	Paziente -
	<c:out value="${codFiscale}" />
</h2>

<h3>Schede base</h3>
<c:choose>
	<c:when test="${not empty schedeBase}">
		<table style="width: 100%;">
			<tr>
				<th style="width: 40%">Malattia</th>
				<th style="width: 30%">Ghiandola</th>
				<th style="width: 20%">Data diagnosi</th>
				<th></th>
				<th></th>
				<th></th>
			</tr>
			<c:forEach var="summary" items="${schedeBase}">
				<sf:form method="POST" action="malattia/operation"
					modelAttribute="malattiaPaziente" id="${summary.malattia}">
					<input type="hidden" name="idMalattia"
						value="${summary.idMalattia}" />
					<input type="hidden" name="malattia"
						value="${summary.malattia}" />
					<tr>
						<td><c:out value="${summary.malattia}" /></td>
						<td><c:out value="${summary.ghiandola}" /></td>
						<td><c:out value="${summary.anno}" />/<c:out
								value="${summary.mese}" /></td>
						<td style="text-align: center;">
							<a href="#" title="Vedi i dettagli della scheda base" 
							   onclick="document.getElementById('operation-${summary.malattia}').setAttribute('value', 'view');document.getElementById('${summary.malattia}').submit();">
							   <img alt="Visualizza scheda base"
							        src="/researchendoWeb/resources/images/right_arrow.png" />
							</a>
						</td>
						<td>
							
							<a href="#" title="Modifica i dettagli della scheda base"
							   onclick="document.getElementById('operation-${summary.malattia}').setAttribute('value', 'edit');document.getElementById('${summary.malattia}').submit();">
								<img alt="Modifica scheda base" src="/researchendoWeb/resources/images/edit-icon.png" />
							</a>
						</td>
						<td>
							
							<a href="#" title="Aggiungi una scheda follow-up"
							   onclick="document.getElementById('operation-${summary.malattia}').setAttribute('value', 'sfu');document.getElementById('${summary.malattia}').submit();">
								<img alt="Modifica scheda base" src="/researchendoWeb/resources/images/aggiunta-sfu.png" />
							</a>
						</td>
					</tr>
					<!-- Indica quale operazione e' stata scelta -->
					<input type="hidden" id="operation-${summary.malattia}" name="operazione" value="view" />
				</sf:form>
			</c:forEach>
		</table>
	</c:when>
	<c:otherwise>
		Nessun paziente trovato.
	</c:otherwise>
</c:choose>
<sf:form method="POST" modelAttribute="malattiaPaziente" action="malattia/indietro">
	<sf:button>Indietro</sf:button>
</sf:form>
